'use strict';

describe('Filter: searchFilters', function () {

    // load the filter's module
    beforeEach(module('homepageApp'));

    // initialize a new instance of the filter before each test
    var searchFilters;
    beforeEach(inject(function ($filter) {
        searchFilters = $filter('searchFilters');
    }));

    it('should return the input prefixed with "searchFilters filter:"', function () {
        var allPosts = [{"postDateTime":{"S":"2014-03-29T15:09:24.490Z"},"title":{"S":"Welcome"},"post":{"S":"This site is to showcase the things I'm working on right now or have worked on in the past during my free time. It's also so I can practice my presentation skills. I think you'll get the point once you take a look around. The code to everything will be in its own seprate project on google code so you can access it and try it yourself. Enjoy the site!"},"page_id":{"N":"1"}},{"postDateTime":{"S":"2014-04-25T15:09:24.490Z"},"title":{"S":"The Importance of Test Driven Development"},"post":{"S":"When we decide to start coding with thinking about testing there are several negative consequences. The first and most important is that we fall under the illusion that we are complete the task at hand because we the program begin to give us the results we want. The problem is that we are creating code that may or may not be testable later on. If we indeed create code which is not testable we lose the ability to test extreme conditions efficiently..."},"page_id":{"N":"1"}}];
        var expectedPost = [{"postDateTime":{"S":"2014-03-29T15:09:24.490Z"},"title":{"S":"Welcome"},"post":{"S":"This site is to showcase the things I'm working on right now or have worked on in the past during my free time. It's also so I can practice my presentation skills. I think you'll get the point once you take a look around. The code to everything will be in its own seprate project on google code so you can access it and try it yourself. Enjoy the site!"},"page_id":{"N":"1"}}];
        //var expectedPost ='a';
        expect(searchFilters(allPosts,'Welcome')).toEqual( expectedPost);
    });

});
